<include file="public:header" />
<!--机型信息管理-->
<div class="pad_lr_10">

<div class="explain_col pad_10">
    <b>说明： 如果机型已经存在会自动更新。</b>
</div>
<table width="100%" cellspacing="0" class="search_form">
    <tbody>
        <tr>
            <td>
                <div class="explain_col">                                    
                    <div id="J_upload_excel" class="btn" style="clear: both;"><span>{:L('upload_excel')}</span></div> 
                    <div class="btn" style=" float:right;"><span><a href="__EXCEL_TEMP__modelInfo.xls">模板下载</a></span></div> 
                     
                </div>
            </td>
        </tr>
    </tbody>
</table>

    <div class="J_tablelist table_list" data-acturi="{:U('modelInfo/ajax_edit')}">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
                <th width="40"><input type="checkbox" name="checkall" class="J_checkall"></th>
                <th width="40">ID</th>
                <th>机型</th>
                <th>销售价格</th>
                <th>产品参数</th>
      			<th>单台提成</th>
                <th>功能亮点</th>
                <th width=100>{:L('operations_manage')}</th>
            </tr>
            </thead>
    	    <tbody>
            <volist name="list" id="val" >
            <tr>
                <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                <td align="center">{$val.id}</td>
                <td align="center"><span data-tdtype="edit" data-field="modelName" class="tdedit" data-id="{$val.id}">{$val.modelName}</span></td>
                <td align="center">{$val.salesPrice}</td>
                <td align="center">{$val.product}</td>
                <td align="center">{$val.singleRoyalty}</td>
                <td align="center">
                  {$val.highlights}
                </td>
                <td align="center">

                    <a href="javascript:;" class="J_confirmurl" data-acttype="ajax"  data-uri="{:U('modelInfo/delete', array('id'=>$val['id']))}" data-msg="{:sprintf(L('confirm_delete_one'),$val['modelName'])}">{:L('delete')}</a>
                </td>
            </tr>
            </volist>
    	   </tbody>
        </table>
    </div>
    <div class="btn_wrap_fixed">
		<label class="select_all mr10"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
    	<input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('modelInfo/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
		<div id="pages">{$page}</div>
    </div>
</div>
<include file="public:footer" />
<script src="__STATIC__/js/fileuploader.js"></script>
<script>

	//上传excel
    var uploader = new qq.FileUploaderBasic({
    	allowedExtensions: ['xls'],
        button: document.getElementById('J_upload_excel'),
        multiple: false,
        action: "{:U('import/importModelInfo')}",
        inputName: 'excel',
        forceMultipart: true, //用$_FILES
        messages: {
        	typeError: lang.upload_type_error,        	
        	minSizeError: lang.upload_minsize_error,
        	emptyError: lang.upload_empty_error,
        	noFilesError: lang.upload_nofile_error,
        	onLeave: lang.upload_onLeave
        },
        showMessage: function(message){
        	$.pinphp.tip({content:message, icon:'error'});
        },
        onSubmit: function(id, fileName){
        	$('#J_upload_excel').addClass('btn_disabled').find('span').text(lang.uploading);
        },
        onComplete: function(id, fileName, result){ 
        	$('#J_upload_excel').removeClass('btn_disabled').find('span').text(lang.upload_excel);
            if(result.status == '1'){
        		//$('#J_img').val(result.data);
                $.pinphp.tip({content:result.msg, icon:'success'});
        	} else {
        		$.pinphp.tip({content:result.msg, icon:'error'});
        	}
        }
    });
    
</script>
</body>
</html>